import * as Type from "./type";
import * as request from "@/common/request";
import { CommonResult } from "@/common/request/result.type";

const newError = () => new Error("请求失败");

/**
 * 查看我的团队
 */
export async function listTeamByUserIdApi(): Promise<CommonResult<Type.TeamInfo[]>> {
  try {
    const { data } = await request.get<Type.TeamInfo[]>("/team/myTeam");
    return data;
  } catch {
    throw newError();
  }
}
